//
//  ThirthViewController.m
//  UI豆瓣2015到2016跨年作业
//
//  Created by LHY on 15/12/31.
//  Copyright © 2015年 Lanou 32 李昊宇. All rights reserved.
//

#import "ThirthViewController.h"

@interface ThirthViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic , retain) NSMutableArray *arrModlecin;

@property (nonatomic , retain) UITableView *tableView;


@end

@implementation ThirthViewController

- (void)dealloc
{
    [_arrModlecin release];
    [_tableView release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.1 green:0.5 blue:0.7 alpha:1];

    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"影院";
    
    self.tableView = [[UITableView alloc] initWithFrame:self.view.frame style:(UITableViewStylePlain)];
    [self.view addSubview:_tableView];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    
    [_tableView registerClass:[TwoTableViewCell class] forCellReuseIdentifier:@"cell"];
    
    [self DateCinema];




}
- (void)DateCinema {
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"cinema" ofType:@"plist"];
    NSArray *arr = [NSArray arrayWithContentsOfFile:path];
    self.arrModlecin = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        CinemaModel *cin = [CinemaModel cinemaModel];
        [cin setValuesForKeysWithDictionary:dic];
        [_arrModlecin addObject:cin];
    }
    
    
    
}





- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return _arrModlecin.count;
    
    
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 180;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TwoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    CinemaModel *mod = _arrModlecin[indexPath.row];
    cell.addressLabel.text = mod.address;
    cell.cinemaNameLabel.text = mod.cinemaName;
    cell.telephone.text = mod.telephone;
    return cell;
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
